import request from '@/config/axios'

// ERP采购管理-供应商原料报价主 VO
export interface PurRawMaterialQuotationVO {
  id: string // 报价单ID
  quotationNo: string // 报价单号
  supplierId: string // 供应商ID
  supplierName: string // 供应商名称
  quotationDate: Date // 日期
  isApproved: boolean // 审核
  approver: string // 审核人
  approveTime: Date // 审核时间
  quotationUnit: string // 报价单位
  isCalculatedByGrossBoard: boolean // 采购是否按毛板计价
  minimumOrderUnit: string // 起订数单位
  remark: string // 备注
}

// ERP采购管理-供应商原料报价主 API
export const PurRawMaterialQuotationApi = {
  // 查询ERP采购管理-供应商原料报价主分页
  getPurRawMaterialQuotationPage: async (params: any) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/page`, params })
  },

  // 查询ERP采购管理-供应商原料报价主详情
  getPurRawMaterialQuotation: async (id: number) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/get?id=` + id })
  },

  // 新增ERP采购管理-供应商原料报价主
  createPurRawMaterialQuotation: async (data: PurRawMaterialQuotationVO) => {
    return await request.post({ url: `/erp/pur-raw-material-quotation/create`, data })
  },

  // 修改ERP采购管理-供应商原料报价主
  updatePurRawMaterialQuotation: async (data: PurRawMaterialQuotationVO) => {
    return await request.put({ url: `/erp/pur-raw-material-quotation/update`, data })
  },

  // 删除ERP采购管理-供应商原料报价主
  deletePurRawMaterialQuotation: async (id: number) => {
    return await request.delete({ url: `/erp/pur-raw-material-quotation/delete?id=` + id })
  },

  // 导出ERP采购管理-供应商原料报价主 Excel
  exportPurRawMaterialQuotation: async (params) => {
    return await request.download({ url: `/erp/pur-raw-material-quotation/export-excel`, params })
  },

// ==================== 子表（ERP采购管理-采购明细材质信息） ====================

  // 获得ERP采购管理-采购明细材质信息分页
  getPurRawMaterialQuotationDetailPage: async (params) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-detail/page`, params })
  },
  // 新增ERP采购管理-采购明细材质信息
  createPurRawMaterialQuotationDetail: async (data) => {
    return await request.post({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-detail/create`, data })
  },

  // 修改ERP采购管理-采购明细材质信息
  updatePurRawMaterialQuotationDetail: async (data) => {
    return await request.put({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-detail/update`, data })
  },

  // 删除ERP采购管理-采购明细材质信息
  deletePurRawMaterialQuotationDetail: async (id: number) => {
    return await request.delete({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-detail/delete?id=` + id })
  },

  // 获得ERP采购管理-采购明细材质信息
  getPurRawMaterialQuotationDetail: async (id: number) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-detail/get?id=` + id })
  },

// ==================== 子表（ERP采购管理-供应商原料报价净板参考计价规格） ====================

  // 获得ERP采购管理-供应商原料报价净板参考计价规格分页
  getPurRawMaterialQuotationNetBoardReferenceQuotationSpecPage: async (params) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-net-board-reference-quotation-spec/page`, params })
  },
  // 新增ERP采购管理-供应商原料报价净板参考计价规格
  createPurRawMaterialQuotationNetBoardReferenceQuotationSpec: async (data) => {
    return await request.post({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-net-board-reference-quotation-spec/create`, data })
  },

  // 修改ERP采购管理-供应商原料报价净板参考计价规格
  updatePurRawMaterialQuotationNetBoardReferenceQuotationSpec: async (data) => {
    return await request.put({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-net-board-reference-quotation-spec/update`, data })
  },

  // 删除ERP采购管理-供应商原料报价净板参考计价规格
  deletePurRawMaterialQuotationNetBoardReferenceQuotationSpec: async (id: number) => {
    return await request.delete({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-net-board-reference-quotation-spec/delete?id=` + id })
  },

  // 获得ERP采购管理-供应商原料报价净板参考计价规格
  getPurRawMaterialQuotationNetBoardReferenceQuotationSpec: async (id: number) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-net-board-reference-quotation-spec/get?id=` + id })
  },

// ==================== 子表（ERP采购管理-供应商原料报价压线数量级限定） ====================

  // 获得ERP采购管理-供应商原料报价压线数量级限定分页
  getPurRawMaterialQuotationPressLineQuantityLimitPage: async (params) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-press-line-quantity-limit/page`, params })
  },
  // 新增ERP采购管理-供应商原料报价压线数量级限定
  createPurRawMaterialQuotationPressLineQuantityLimit: async (data) => {
    return await request.post({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-press-line-quantity-limit/create`, data })
  },

  // 修改ERP采购管理-供应商原料报价压线数量级限定
  updatePurRawMaterialQuotationPressLineQuantityLimit: async (data) => {
    return await request.put({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-press-line-quantity-limit/update`, data })
  },

  // 删除ERP采购管理-供应商原料报价压线数量级限定
  deletePurRawMaterialQuotationPressLineQuantityLimit: async (id: number) => {
    return await request.delete({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-press-line-quantity-limit/delete?id=` + id })
  },

  // 获得ERP采购管理-供应商原料报价压线数量级限定
  getPurRawMaterialQuotationPressLineQuantityLimit: async (id: number) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-press-line-quantity-limit/get?id=` + id })
  },

// ==================== 子表（ERP采购管理-供应商原料报价加工费） ====================

  // 获得ERP采购管理-供应商原料报价加工费分页
  getPurRawMaterialQuotationProcessFeePage: async (params) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-process-fee/page`, params })
  },
  // 新增ERP采购管理-供应商原料报价加工费
  createPurRawMaterialQuotationProcessFee: async (data) => {
    return await request.post({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-process-fee/create`, data })
  },

  // 修改ERP采购管理-供应商原料报价加工费
  updatePurRawMaterialQuotationProcessFee: async (data) => {
    return await request.put({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-process-fee/update`, data })
  },

  // 删除ERP采购管理-供应商原料报价加工费
  deletePurRawMaterialQuotationProcessFee: async (id: number) => {
    return await request.delete({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-process-fee/delete?id=` + id })
  },

  // 获得ERP采购管理-供应商原料报价加工费
  getPurRawMaterialQuotationProcessFee: async (id: number) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-process-fee/get?id=` + id })
  },

// ==================== 子表（ERP采购管理-供应商原料报价数量级别优惠） ====================

  // 获得ERP采购管理-供应商原料报价数量级别优惠分页
  getPurRawMaterialQuotationQuantityDiscountPage: async (params) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-quantity-discount/page`, params })
  },
  // 新增ERP采购管理-供应商原料报价数量级别优惠
  createPurRawMaterialQuotationQuantityDiscount: async (data) => {
    return await request.post({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-quantity-discount/create`, data })
  },

  // 修改ERP采购管理-供应商原料报价数量级别优惠
  updatePurRawMaterialQuotationQuantityDiscount: async (data) => {
    return await request.put({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-quantity-discount/update`, data })
  },

  // 删除ERP采购管理-供应商原料报价数量级别优惠
  deletePurRawMaterialQuotationQuantityDiscount: async (id: number) => {
    return await request.delete({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-quantity-discount/delete?id=` + id })
  },

  // 获得ERP采购管理-供应商原料报价数量级别优惠
  getPurRawMaterialQuotationQuantityDiscount: async (id: number) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-quantity-discount/get?id=` + id })
  },

// ==================== 子表（ERP采购管理-供应商原料报价原纸报价） ====================

  // 获得ERP采购管理-供应商原料报价原纸报价分页
  getPurRawMaterialQuotationRawPaperPage: async (params) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-raw-paper/page`, params })
  },
  // 新增ERP采购管理-供应商原料报价原纸报价
  createPurRawMaterialQuotationRawPaper: async (data) => {
    return await request.post({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-raw-paper/create`, data })
  },

  // 修改ERP采购管理-供应商原料报价原纸报价
  updatePurRawMaterialQuotationRawPaper: async (data) => {
    return await request.put({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-raw-paper/update`, data })
  },

  // 删除ERP采购管理-供应商原料报价原纸报价
  deletePurRawMaterialQuotationRawPaper: async (id: number) => {
    return await request.delete({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-raw-paper/delete?id=` + id })
  },

  // 获得ERP采购管理-供应商原料报价原纸报价
  getPurRawMaterialQuotationRawPaper: async (id: number) => {
    return await request.get({ url: `/erp/pur-raw-material-quotation/pur-raw-material-quotation-raw-paper/get?id=` + id })
  }
}